<script type="text/javascript" src="/js/flowplayer-3.2.4.min.js"></script>
<script type="text/javascript">
    var newsArray;
    var splitStr = "$$$$$$$";
    var pageNum = 1;


    function loadBody(currentPageNum) {
        var newsBody = $("#divBody");

        if (newsArray != null && currentPageNum > 0 && currentPageNum <= newsArray.length) {
            newsBody.html("");

            newsBody.html(newsArray[currentPageNum - 1] + setNavigation(currentPageNum - 1));
            $("#divLoginId").focus();
        }


    }

    function setPageData(currentPageNum) {
        var pageNo = currentPageNum + 1;
        window.location.href = "<?php echo url_for('news/detail?id='.$newsId.'&page=') ?>" + pageNo;
    }
    function setNavigation(currentPageNum) {
        pageNum = currentPageNum;
        var navigation = "<div class=\"page_list\"><span ";
        if (currentPageNum != 0)
            navigation += "onClick=\"setPageData(pageNum-1)\" style=\"cursor:pointer\"";
        else
            navigation += "style=\"color:#d0d0d0\"";
        navigation += ">上一页</span>";

        for (var i = 0; i < newsArray.length; i++) {
            var temp = i + 1;
            navigation += " <span ";
            if (pageNum == i)
                navigation += "class=\"now02\"";
            else
                navigation += " onClick=\"setPageData(" + i + ")\" style=\"cursor:pointer\""
            navigation += " >" + temp + "</span>";
        }
        navigation += " <span ";
        if (pageNum != (newsArray.length - 1))
            navigation += "onClick=\"setPageData(pageNum+1)\" style=\"cursor:pointer\"";
        else
            navigation += "style=\"color:#d0d0d0\"";
        navigation += ">下一页</span></div>";

        return navigation;
    }
</script>
<div class="main">
    <div class="left">
        <?php
           $recordCount = 4;
        //$catalogId = 1000;
        @include_component("system", "menuNavigator", array("catalogId" => $row_array["catalog_id"], "subCatalogId" => $row_array["sub_catalog_id"], "cssStr" => "address_tit address_tit301"));
        @include_component("news", "contentMenu", array("catalogId" => $row_array["catalog_id"]));
        //print_r($row_array);
        ?>
        <div class="detail">
            <h2><?php echo $row_array["title"]; ?></h2>

            <h3>来源：<span><?php echo $row_array["source"]; ?></span> 作者：<span><?php echo $row_array["author"]; ?></span>
                时间：<span><?php echo $row_array["currentTime"]; ?></span>
                Tag：<span><?php echo $row_array["tag"]; ?></span>
                点击：<span><?php echo ($row_array["hit_mask_i"] + $row_array["hit_i"]); ?></span></h3>

            <div class="detail_text" id="divBody">
            </div>
            <script type="text/javascript">
                //                loadBody();
                var tempBody = "<?php echo $row_array["body"]; ?>";
                newsArray = tempBody.split(splitStr);
                loadBody(<?php echo $pageNo; ?>);
            </script>
            <div class="detail_xg"><a
                    href="javascript:window.external.AddFavorite('<?php echo "http://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];?>', '<?php echo $row_array["title"] . "-" . sfConfig::get("app_site_name");?>')">收藏</a>
                | <a onclick="$('#pl_key').focus();" style="cursor:pointer;">评论</a> | <a
                        href="javascript:window.print();">打印</a> | <a
                        href="javascript:window.open('','_parent',''); window.close();">关闭</a></div>
            <div class="detail_ico"><?php echo link_to("<img src='/images/04.gif' />", "http://www.kaixin001.com/repaste/share.php?rtitle=" . urlencode($row_array["title"]) . "&rurl=" . $url . "news/detail?id=" . $row_array["news_id"] . "&rcontent=" . utility::getNoHtmlStr($row_array["brief"], 0, 100), "title='转贴到开心网' target='_blank'");?><?php echo link_to("<img src='/images/05.gif' />", "http://share.renren.com/share/buttonshare.do?title=" . urlencode($row_array["title"]) . "&link=" . $url . "news/detail?id=" . $row_array["news_id"], "title='转贴到人人网' target='_blank'");?><?php echo link_to("<img src='/images/07.gif' />", "http://v.t.sina.com.cn/share/share.php?title=" . urlencode($row_array["title"]) . "&url=" . $url . "news/detail?id=" . $row_array["news_id"] . "&rcontent=" . utility::getNoHtmlStr($row_array["brief"], 0, 100), "title='转贴到新浪微博' target='_blank'");?><?php echo link_to("<img src='/images/ico_dou.png' />", "http://www.douban.com/recommend/?title=" . urlencode($row_array["title"]) . "&url=" . $url . "news/detail?id=" . $row_array["news_id"], "title='转贴到豆瓣网' target='_blank'");?><?php echo link_to("<img src='/images/souhu.jpg' />", "http://t.sohu.com/third/post.jsp?content=utf-8&title=" . urlencode($row_array["title"]) . utility::getNoHtmlStr($row_array["brief"], 0, 100) . "&url=" . $url . "news/detail?id=" . $row_array["news_id"], "title='转贴到搜狐网' target='_blank'");?>
                <img src="/images/08.gif"/></div>
        </div>
        <?php
               //<!--相关新闻 -->
        @include_component("news", "related", array("recordCount" => $recordCount, "contentId" => $newsId, "moreLinkDisplay" => "none", "contentTypeId" => 1000));
        //<!--relate video -->
        @include_component("video", "related", array("recordCount" => 6, "contentId" => $newsId, "contentTypeId" => 1000));
        //<!--relate photo -->
        @include_component("album", "related", array("recordCount" => 8, "contentId" => $newsId, "contentTypeId" => 1000));
        //<!--留言评论-->
        @include_component("user", "comment", array("recordCount" => 4, "contentId" => $newsId, "contentTypeId" => 1000));
        //<!--杂志报道 -->
        //@include_component("magazine","latest");
        ?>
    </div>
    <div class="right">
        <?php
                @include_component("other", "advertise");
            //<!--最新新闻-->
            @include_component("news", "latest", array("recordCount" => 5, "catalogId" => $row_array["catalog_id"]));
            //<!--最热新闻-->
            @include_component("news", "hotlink", array("recordCount" => 5, "catalogId" => $row_array["catalog_id"]));
            //<!--推荐新闻-->
            @include_component("news", "recommend", array("recordCount" => 10));
            //<!--视频特别推荐-->
            @include_component("video", "recommend", array("recordCount" => 10, "catalogId" => $row_array["catalog_id"]));
            //<!--美图下载-->
            @include_component("album", "recommend2", array("recordCount" => 9));
            ?>
    </div>
</div>